﻿using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using System.Net;
using System.Text;

namespace Framework.Utility.Middleware
{
    public static class HealthCheckMiddleware
    {
        public static void UseHealthCheckMiddleware(this IApplicationBuilder app,string  checkPath="/healthcheck")
        {
            app.Map(checkPath, app => app.Run(async context =>
            {
                context.Response.StatusCode= (int)HttpStatusCode.OK;
                await context.Response.WriteAsync("Dev.Support Api Is OK");
            }));
        }

    }
}